# Contributor: Sertonix <sertonix@posteo.net>
# Maintainer: Sertonix <sertonix@posteo.net>
pkgname=dinit
pkgver=0.18.0
pkgrel=1
pkgdesc="Service monitoring/init system"
url="https://github.com/davmac314/dinit"
arch="all"
license="Apache-2.0"
subpackages="$pkgname-doc $pkgname-shutdown:_shutdown"
makedepends="m4"
source="https://github.com/davmac314/dinit/releases/download/v$pkgver/dinit-$pkgver.tar.xz"

build() {
	make BUILD_SHUTDOWN=yes SHUTDOWN_PREFIX="dinit-"
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir"/ BUILD_SHUTDOWN=yes SHUTDOWN_PREFIX="dinit-" install
}

_shutdown() {
	pkgdesc="dinit shutdown utils"
	depends="$pkgname"

	amove sbin/dinit-shutdown
	amove sbin/dinit-halt
	amove sbin/dinit-reboot
	amove sbin/dinit-poweroff
}

sha512sums="
bacb71b35e348a73c0a082599c357d05a773680d302f9b963e109b289fa5cd4ec616f73febaa76c96075e58711ffb14d84f2c734461a171f37b827038e1f9c1b  dinit-0.18.0.tar.xz
"
